package site.suimu.service.impl;

import org.springframework.stereotype.Service;
import site.suimu.mapper.TnewMapper;
import site.suimu.pojo.Tnew;
import site.suimu.service.TnewService;

import javax.annotation.Resource;
import java.util.List;

@Service
public class TnewServiceImpl implements TnewService {

    @Resource
    TnewMapper tnewMapper;

    public boolean insNew(Tnew tnew) {
        if(tnewMapper.create(tnew)>0){
            return true;
        }
        return false;
    }

    public boolean updNew(Tnew tnew) {
        if(tnewMapper.update(tnew)>0){
            return true;
        }
        return false;
    }

    public boolean dleNew(int nid) {
        if(tnewMapper.delete(nid)>0){
            return true;
        }
        return false;
    }

    public Tnew sleById(int nid) {
        return tnewMapper.selectById(nid);
    }

    public List<Tnew> sleByType(int type) {
        return tnewMapper.selectByType(type);
    }
}
